﻿using System;
using System.Globalization;
using System.Threading;
using System.Windows;

namespace Number2Letters
{

    public partial class App : Application
    {

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            // If I don't found any argument...
            if (e.Args.GetUpperBound(0) < 0)
                return;

            try
            {
                // If the argument is a definition of a culture
                CultureInfo culture = new CultureInfo(e.Args[0]);

                // I set the culture to the current thread
                Thread.CurrentThread.CurrentUICulture = culture;
                Thread.CurrentThread.CurrentCulture = culture;
            }
            catch { }

        }

    }
}